package com.learn;

import org.springframework.web.client.RestTemplate;

import com.google.gson.Gson;
import com.learn.common.Response;

public class App {
	static String BASE_URL="http://127.0.0.1:8080";
    public static void main( String[] args ){
        RestTemplate rt = new RestTemplate();
        String body = rt.getForObject(BASE_URL+"/product/1", String.class);
        System.out.println(body);
        Response res = new Gson().fromJson(body, Response.class);
        System.out.println(res.getCode());
        System.out.println(res.getMsg());
        System.out.println(res.getData());
    }
}
